<?php

$xtpl = new XTemplate("modules/home/support_online.htm");


//--

//--
$waypathlink = '&raquo;&nbsp;<a href="#" class="waypath_sub">Support Online Management</a>';
$xtpl->assign("waypathlink",$waypathlink);
//--
//--
//--
$add_button = $GUI->button_ren("New","javascript: add('?mod=home&act=support_online_task');");
$xtpl->assign("add_button",$add_button);
//--
$delete_button = $GUI->button_ren("Delete","javascript: del('DELETE', document.frmAddnews);");
$xtpl->assign("delete_button",$delete_button);
//--
//--
//--

//////


//////////////////////////
$rs = mysql_query("SELECT * FROM {$DP}support_online");

$no=1;
while($row = mysql_fetch_array($rs)){
	$row[no]=$no++;	
	if($no%2!=0)
		$row['class'] = "row1";
	else 
		$row['class'] = "row2";
	//--
	$row[edit_link] = '?mod=home&act=support_online_task&id='.$row['id'].'';
	//--

	$row['name']=stripslashes($row['name']);
	$row['nick']=stripslashes($row['nick']);
	$row['type']=stripslashes($row['type']);
	$row['id'] = $row['id'];

	
	//--
	$xtpl->assign("list",$row);
	$xtpl->parse("center.list");
}
//--


//--
//--
//--
if($_POST['type'] == "DELETE"){
	$checked_delete = $_POST[checked_delete];
	for ($i=0;$i<count($checked_delete);$i++) {
		$delete_list.= $checked_delete[$i].",";
	}
	if($delete_list){
		$delete_list = substr($delete_list,0,strlen($delete_list)-1);
		$delete_split=split(",",$delete_list);
		for($i=0;$i<count($delete_split);$i++){

			//--	
			$sql = "DELETE FROM {$DP}support_online WHERE id='".$delete_split[$i]."'";
			mysql_query($sql);
		}
	}
	if($_GET['page'] != '')
		$GUI->redir('?mod=home&act=support_online');
	else
		$GUI->redir('?mod=home&act=support_online');
}

//$xtpl->parse("center");
//$xtpl->assign("center_file",$xtpl->text("center"));
//--
/*$xtpl->assign("path_site",$base_url);
//--
if($_SESSION[ses_admin_id] != ''){
	$xtpl->parse("MAIN.mainbody");
}elseif($_SESSION[ses_admin_id] == ''){	
	$xtpl->parse("MAIN.login");
}
//--
$xtpl->parse("MAIN");
eval("?".">".$xtpl->text("MAIN"));
*/
//-- Old Feature Function
/*if($_GET['thisID'] != ''){
	if($_GET['doit'] == 'add'){
		$value = '1';
	}elseif($_GET['doit'] == 'remove'){
		$value = '0';
	}
	$sql = "UPDATE {$DP}news SET is_feature = '".$value."' WHERE id = '".$_GET['thisID']."'";
	mysql_query($sql);
	$GUI->redir('?mod=home&act=news&page='.$_GET['page']);
}*/
//--
?>